define(['jquery', 'bootstrap', 'backend', 'addtabs', 'table', 'echarts', 'echarts-theme', 'template'], function ($, undefined, Backend, Datatable, Table, Echarts, undefined, Template) {

    var Controller = {
        index: function () {
            // 初始化表格参数配置
            Table.api.init({
                extend: {
                    index_url: 'dashboard/warehouselist' + location.search,
                    table: 'litestore_goods',
                },
                exportOptions: {
                    fileName: 'export_' + Moment().format("YYYY-MM-DD"),
                    ignoreColumn: ['operate'] //默认不导出第一列(checkbox)与操作(operate)列
                }
            });


            var table = $("#table");

            // 初始化表格
            table.bootstrapTable({
                url: $.fn.bootstrapTable.defaults.extend.index_url,
                pk: 'id',
                sortName: 'id',
                columns: [
                    [
                        {field: 'oi_year', title: '年份',visible:false,operate:'LIKE'},
                        {field: 'oi_cate_name', title: '分类名',visible:false,operate:'LIKE'},
                        {field: 'cate_name', title: '品类',operate:false},
                        {field: 'specs', title: '规格',operate:false},
                        {field: 'oi_is_fear_query', title: '是否怕查',searchList: {"0":"否","1":'是'}, formatter: Table.api.formatter.status },
                        {field: 'total', title: '总数',operate:false},
                        {field: 'price_total', title: '总价值',operate:false},
                        {field: 'unit_Price', title:'平均价',operate:false},
                    ]
                ]
            });
            // 为表格绑定事件
            Table.api.bindevent(table);

        },
    };

    return Controller;
});
